perm filename IMPMLT[SS,SYS] blob sn#345682 filedate 1983-05-20 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00007 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	TITLE ITEST
C00003 00003	 Cono Bits . . .
C00005 00004	 Data areas . . .
C00006 00005	BEG:	calli
C00009 00006	donop:	cono imp,strout!odpien
C00010 00007	isloop:	coni imp,2
C00012 ENDMK
C⊗;
TITLE ITEST

IMP←←400
; Cono Bits . . .

test←←100000		; Enter test mode (does anal-cranial inversion)
strin←←040000		; Start input, sets stop, clears input end
i32←←020000		; Set input byte size to 32b if IDPIEN set
o32←←010000		; Set output byte size to 32b if ODPIEN set
clrst←←004000		; Clear stop after input bit
clrwt←←002000		; Clear waiting to input bit
strout←←000200		; Start output
fino←←000100		; Finish output (last bit has been sent)
iepien←←000040		; Enable change of input end interrupt channel
idpien←←000020		; Enable change of input byte size and input done interrupt channel
odpien←←000010		; Enable change of output byte size and output done interrupt channel


; Coni bits . . .

test←←100000		; Enter test mode (does anal-cranial inversion)
imperr←←040000		; Imp error
idone←←020000		; Input done
iend←←010000		; Input end.
odone←←004000		; Output done
; Data areas . . .

array illeg[4],blok[4],dead[4],blkout[3],blkin[12],mestyp[12]
pln←←20
array ipdl[pln],opdl[pln],pdl[pln]
integer nmesin,blkip,start,ipdp,opdp,nnops,lsthk,lstsn

; Output pointers

ohstp:	point 2,blkout,9
ositp:	point 6,blkout,15
oopcd:	point 8,blkout+2,7

; Input pointers

ihstp:	point 2,blkin,9
isitp:	point 6,blkin,15
eilnkp:	point 8,blkin,15
itypep:	point 4,blkin,7
iopcd:	point 8,blkin+2,7

nhosts←←20
blkmsk←←177777
p←←17
rst←←14
BEG:	calli
	setzm blkout
	setzm blkout+1
	setzm blkout+2
	setzm mestyp
	move 1,[xwd mestyp,mestyp+1]
	blt 1,mestyp+11
	move p,[iowd pln,pdl]
	setom start
	move 1,[400001,,spw]
	call 1,[sixbit /SPCWGO/]
break:	inchwl 1
	jrst break

spwst:	move p,[iowd pln,ipdl]
	push p,[isloop]
	movem p,ipdp
	cono imp,odpien!idpien!iepien!strin!clrst!clrwt
	cono imp,clrst!clrwt
	move p,[iowd pln,opdl]
	setzm start
	movei 1,4
	movem 1,nnops
spwo1:	pushj p,donop
	sosle nnops
	jrst spwo1

dinit:	movei 3,3
	setzm illtyp
wtlp3:	setzm dead(3)
	setzm illeg(3)
	setzm blok(3)
	sojge 3,wtlp3
	setzm nmesin
	movei 3,3
	movei 2,nhosts
dorst:	movem 2,lsthk
	movem 3,lstsn
	dpb 3,ohstp
	dpb 2,ositp
	movei 4,1
	lsh 4,(2)
	tdne 4,blok(3)
	jrst incr
	orm 4,blok(3)
	andcam 4,dead(3)
	andcam 4,illeg(3)
	movei 4,10
	dpb 4,[point 8,blkout+1,11]
	movei 4,1
	dpb 4,[point 8,blkout+1,27]
	movei 4,rst
	dpb 4,oopcd
	cono imp,strout!odpien
	datao imp,blkout
	pushj p,osync
	datao imp,blkout+1
	pushj p,osync
	datao imp,blkout+2
	pushj p,osync
	cono imp,fino
	pushj p,osync

incr:	move 2,lsthk
	move 3,lstsn
	sojge 3,dorst
	movei 3,3
	sojge 2,dorst
wtlp1:	movei 3,3
wtlpl:	setcm 4,blok(3)
	trne 4,blkmsk
	jrst wtidle
	sojge 3,wtlpl
	jrst dinit

wtidle:	pushj p,donop
	jrst wtlp1
donop:	cono imp,strout!odpien
	datao imp,[4B7]
	pushj p,osync
	cono imp,fino
osync:	movem p,opdp
spw:	skipe start
	jrst spwst
	consz imp,iend!idone
	jrst spwin
	consz imp,odone
	jrst spwout
	call [sixbit /DISMIS/]

isync:	movem p,ipdp
	jrst spw

spwin:	aos atspwi#
	skipa p,ipdp
spwout:	move p,opdp
	popj p,
isloop:	coni imp,2
	datai imp,blkin
	move 1,[xwd -12,blkin]
	movem 1,blkip
islp1:	trne 2,iend
	jrst inpdone
	pushj p,isync
	coni imp,2
	blki imp,blkip
	jfcl
	jrst islp1

inpdone:
	cono imp,strin!idpien!iepien!clrst!clrwt
	cono imp,clrst!clrwt
	ldb 1,itypep
	cail 1,maxmt
	jrst illmes
	aos mestyp(1)
	ldb 3,isitp
	movei 2,1
	lsh 2,(3)
	ldb 3,ihstp
	jrst @dsptab(1)

illmes:	aos illtyp#
	jrst iwait

dsptab:	regular
	ewomi
	down
	blkl
	nop
	rfnm
	ddead
	ewmi
	incompt
maxmt←←.-dsptab

regular:
	ldb 4,iopcd
	aos regtyp(4)
	ldb 5,eilnkp
	hrlm 5,regtyp(4)
	jrst iwait

regtyp:	block 30

ddead:
incompt:
	orm 2,dead(2)
ewmi:
blkl:
rfnm:	aos nmesin
	tdnn 2,blok(3)
	orm 3,dead(3)
	jrst iwait

ill:	orm 2,illeg(3)
ewomi:
down:
nop:
iwait:	pushj p,isync
	jrst isloop

end beg